/*
 * Copyright 1999-2018 Alibaba Group Holding Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// package com.alibaba.druid.util;

// import com.alibaba.druid.DbType;
// import com.alibaba.druid.support.logging.Log;
// import com.alibaba.druid.support.logging.LogFactory;

// import javax.sql.DataSource;

// import java.io.Closeable;
// import java.io.InputStream;
// import java.io.PrintStream;
// import java.net.URL;
// import java.sql.*;
// import java.util.*;

/**
 * @author wenshao [szujobs@hotmail.com]
 */
#pragma once

#include "JdbcConstants.h"
#include "common_ptr.h"

class JdbcUtils {
  public:
    // static Log LOG = LogFactory.getLog(JdbcUtils.class);

    // static Properties DRIVER_URL_MAPPING;

    // static bool mysql_driver_version_6;

    // static void close(Connection* x);

    // static void close(Statement* x) ;

    // static void close(ResultSet* x) ;

    // static void close(Closeable* x) ;

    // static void close(Blob* x) ;

    // static void close(Clob* x) ;

    // static void printResultSet(ResultSet* rs) ;

    // static void printResultSet(ResultSet* rs, PrintStream* out) ;

    // static void printResultSet(ResultSet* rs,
    //                                   PrintStream* out,
    //                                   bool printHeader,
    //                                   string_ptr  seperator) ;

    // static string_ptr  getTypeName(int sqlType);

    // static string_ptr  getDriverClassName(string_ptr  rawUrl);

    // static DbType getDbTypeRaw(string_ptr  rawUrl, string_ptr  driverClassName) ;

    // static string_ptr  getDbType(string_ptr  rawUrl, string_ptr  driverClassName);

    // static Driver* createDriver(string_ptr  driverClassName) ;

    // static Driver* createDriver(ClassLoader* classLoader, string_ptr  driverClassName) ;

    // static int executeUpdate(DataSource* dataSource, string_ptr  sql, std::list<std::shared_ptr<Object> > parameters) ;

    // static int executeUpdate(DataSource* dataSource, string_ptr  sql, std::list<Object> parameters) ;

    // static int executeUpdate(Connection* conn, string_ptr  sql, std::list<Object> parameters) ;

    // static void execute(DataSource* dataSource, string_ptr  sql, std::list<std::shared_ptr<Object> > parameters) ;

    // static void execute(DataSource dataSource, string_ptr  sql, std::list<std::shared_ptr<Object> > parameters) ;

    // static void execute(Connection* conn, string_ptr  sql) ;

    // static void execute(Connection* conn, string_ptr  sql, std::list<std::shared_ptr<Object> > parameters) ;

    // static std::list<std::map<string_ptr , std::shared_ptr<Object> >> executeQuery(DataSource* dataSource, string_ptr  sql, std::list<std::shared_ptr<Object> > parameters);

    // static std::list<std::map<string_ptr , std::shared_ptr<Object> >> executeQuery(DataSource* dataSource, string_ptr  sql, std::list<std::shared_ptr<Object> > parameters);

    // static std::list<std::map<string_ptr , std::shared_ptr<Object> >> executeQuery(Connection* conn, string_ptr  sql, std::list<std::shared_ptr<Object> > parameters);

    // static void setParameters(PreparedStatement* stmt, std::list<Object> parameters) ;

    // static void insertToTable(DataSource* dataSource, string_ptr  tableName, std::map<string_ptr , std::shared_ptr<Object> > data);

    // static void insertToTable(Connection* conn, string_ptr  tableName, std::map<string_ptr , std::shared_ptr<Object> > data) ;

    // static string_ptr  makeInsertToTableSql(string_ptr  tableName, Collection<string_ptr > names) ;

    // static <T> void executeQuery(
    //         DataSource* dataSource,
    //         ResultSetConsumer*<T> consumer,
    //         string_ptr  sql,
    //         std::list<std::shared_ptr<Object> > parameters
    // ) ;

    // static std::list<string_ptr > showTables(Connection* conn, DbType dbType) ;

    // static string_ptr  getCreateTableScript(Connection* conn, DbType dbType) ;

    // static string_ptr  getCreateTableScript(Connection* conn,
    //                                           DbType dbType,
    //                                           bool sorted,
    //                                           bool simplify) ;

    // static bool isMySqlDriver(string_ptr  driverClassName) ;

    static bool isOracleDbType(string_ptr  dbType) ;
    static bool isOracleDbType(DbType_ptr dbType) ;

    // static bool isMysqlDbType(string_ptr  dbTypeName) ;

    // static bool isMysqlDbType(DbType dbType) ;

    // static bool isPgsqlDbType(string_ptr  dbTypeName) ;

    // static bool isPgsqlDbType(DbType dbType) ;

    // static bool isSqlserverDbType(string_ptr  dbTypeName);

    // static bool isSqlserverDbType(DbType dbType) ;
};
